package org.vincen.helloworld.socket;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class TCPSocket {

	public static void main(String[] args) throws UnknownHostException {
		InetAddress address = InetAddress.getLocalHost();
		System.out.println(address);

//		InetAddress[] addresses = InetAddress
//				.getAllByName("http://www.baidu.com");
//		for (InetAddress a : addresses) {
//			System.out.println(a);
//		}
		
		InetAddress address2 = InetAddress.getByName("http://www.baidu.com");
		System.out.println(address2);
	}
}
